1. Field of the Invention
This invention relates to a method and an apparatus for transmitting compression-coded image signals. More particularly, it relates to a method and apparatus to be suitably used for an image coding apparatus employing a coding system like that of the MPEG (the Moving Picture Image Coding Experts Group) adapted for the encoder to limit the rate of bit generation of a bit stream to a given level in order to make the virtual buffer of the decoder neither overflow nor underflow.
2. Prior Art
According to the MPEG, the encoder is required to control the data volume of a bit stream so as make the virtual buffer (hereinafter referred to as VBV) of the decoder neither overflow nor underflow. Additionally, according to the MPEG, the arithmetic operations for controlling the data volume of a VBV are defined as those using real numbers.
According to the MPEG, vbv_delay (hereinafter referred to as VBV delay) expressing the time period from the start of inputting a frame (frame n) into the VBV to the time when it is removed is defined by formula (1) below provided that the input bit rate of the VBV is constant;
xcfx84(n)=90000*B(n)/Rxe2x80x83xe2x80x83(1),
where xcfx84 (n) in formula (1) represents the VBV delay of the VBV for frame n, R represents the input bit rate of the VBV and B (n) represents the volume of the buffer occupied by the VBV immediately before the time when the frame n is removed from the VBV.
For determining the VBV delay through arithmetic operations using formula (1) above, the occupied volume of the buffer B (n) has to be determined accurately.
According to the MPEG, since the arithmetic operations concerning a VBV are defined as those using real numbers as pointed out above, the bit volume to be input to the VBV in a frame period according to the input bit rate R is obtained as a real number. The occupied volume of the buffer B (n) is also obtained as a real number. However, in actual arithmetic operations, the part that undergoing the operation accuracy of arithmetic operations using real numbers will be discarded.
Then, as a result of discarding the part undergoing the operation accuracy of arithmetic operations using real numbers, errors will be gradually accumulated and the actual occupied volume of the buffer B (n) will gradually become smaller than the value obtained by the arithmetic operations using real numbers. As errors are accumulated and the total error gets to a certain level, the VBV delay will no longer be determined correctly relative to the input bit rate R.
Meanwhile, according to the MPEG Standards, the VBV delay is also recursively defined by formula (2) below;
R(n)=d(n)/(xcfx84(n)xe2x88x92xcfx84(n+1)+t(n+1)xe2x88x92t(n))xe2x80x83xe2x80x83(2),
where xcfx84(n) represents the VBV dealy in the VBV of frame (n) and R(n) represents the input bit rate when frame n is input to the VBV, while t(n) represents the time when frame (n) is removed from the VBV and d(n) represents the generated bit volume in frame.
Equation (3) is obtained by adding the values obtained by changing the frame from 0 to nxe2x88x921 in equation (2) above.                     "AutoLeftMatch"                                                            xe2x80x83                                                                                                          R                    ⁡                                          (                      n                      )                                                        *                                      (                                                                  τ                        ⁡                                                  (                          0                          )                                                                    -                                              τ                        ⁡                                                  (                          1                          )                                                                    +                                              t                        ⁡                                                  (                          1                          )                                                                    -                                              t                        ⁡                                                  (                          0                          )                                                                                      )                                                  =                                  d                  ⁡                                      (                    0                    )                                                                                                                        for                  ⁢                                      xe2x80x83                                    ⁢                  n                                =                0                                                                                        xe2x80x83                                                                                                          R                    ⁡                                          (                      n                      )                                                        *                                      (                                                                  τ                        ⁡                                                  (                          1                          )                                                                    -                                              τ                        ⁡                                                  (                          2                          )                                                                    +                                              t                        ⁡                                                  (                          2                          )                                                                    -                                              t                        ⁡                                                  (                          1                          )                                                                                      )                                                  =                                  d                  ⁡                                      (                    1                    )                                                                                                                        for                  ⁢                                      xe2x80x83                                    ⁢                  n                                =                1                                                                                        "AutoLeftMatch"                                                      +                    )                                    _                                                                                                                                                                                                  R                          ⁡                                                      (                            n                            )                                                                          *                                                  (                                                                                    τ                              ⁡                                                              (                                                                  n                                  -                                  1                                                                )                                                                                      -                                                          τ                              ⁡                                                              (                                n                                )                                                                                      +                                                          t                              ⁢                                                              xe2x80x83                                                            ⁢                              n                                                                                )                                                                    -                                              t                        ⁡                                                  (                                                      n                            -                            1                                                    )                                                                                      )                                    =                                      d                    ⁡                                          (                                              n                        -                        1                                            )                                                                      _                                                                                      for                  ⁢                                      xe2x80x83                                    ⁢                  n                                =                                  n                  -                  1                                                                                                        xe2x80x83                                                                                                          R                    ⁡                                          (                      n                      )                                                        *                                      (                                                                  τ                        ⁡                                                  (                          0                          )                                                                    -                                              τ                        ⁡                                                  (                          n                          )                                                                    +                                              t                        ⁡                                                  (                          n                          )                                                                    -                                              t                        ⁡                                                  (                          0                          )                                                                                      )                                                  =                                  ∑                                      d                    ⁡                                          (                                              n                        -                        1                                            )                                                                                                                          xe2x80x83                                                                        (        3        )            
If R(n) is a constant equal to R, the VBV delay free from any accumulation of errors as shown in equation (4) below can be obtained from equation (3), although the sum of the generated bit volumes (xcexa3d(nxe2x88x921)) has to be determined as shown in FIG. 1. In FIG. 1, t(n) represents the time when frame n is removed from the VBV and d(n) represents the generated bit volume in frame n. The total number of bits increases in a manner as indicated by solid line TBN in FIG. 1.
xcfx84(n)=xcfx84(0)+t(n)xe2x88x92t(0)xe2x88x92xcexa3d(nxe2x88x921)/Rxe2x80x83xe2x80x83(4)
FIG. 2 shows a schematic block diagram of a general image compression-coding apparatus adapted to determine the VBV delay (vbv_delay) that is free from any accumulation of errors and insert the value of the VBV delay into the header of the output bit stream by utilizing the sum of the generated bit volumes.
Now, the overall operation of the apparatus of FIG. 2.
Referring to FIG. 5, video data are input to terminal 100 on a frame by frame basis and an externally selected bit rate is input to terminal 102.
MPEG encoder 103 is a popular MPEG vidoe encoder which is adapted to compression-encode the video data supplied from the terminal 100 and output the volume of the generated information for each frame. Additionally, it inserts the value of the VBV delay supplied from VBV delay computing section 104 into the header of the bit stream of the next frame and output the bit stream. The bit stream is then output from terminal 101.
Bit counter 105 receives the volume of the generated information on a frame by frame basis and determines the total sum of the generated information by adding the volumes of the generated information of all the frames. More specifically, as the bit counter recognizes that the volume of the generated information from the MPEG encoder 103 is updated (and the volume of the generated information of the next frame is input), it takes in the volume of the generated information of that frame and adds it the current total sum.
VBV delay computing section 104 receives the total sum (count) of the bits of the generated information output from the bit counter 105, computationally determines the value of the VBV delay, using formula (5) below and outputs the obtained value;
VDR=IVD+EFN*FIxe2x88x92TBN/BR and
xe2x80x83VD=90000*VDRxe2x80x83xe2x80x83(5),
where FI (frame_inverval) represents the frame interval of each frame expressed in terms of number of seconds, EFN (encoded_frame_number) represents the number of frames at the time when the encoding is terminated and TBN (total_bit_number) represents the total sum of the volumes of the generated information input by the bit counter 105, whereas IVD represents the initial value of the VBV delay expressed in terms of number of seconds, BR (bitrate) represents the externally selected bit rate and VDR represents the computationally obtained VBV delay, VD representing the output of the VBV delay output from the VBV delay computing section 104.
From formula (5), the VBV delay (VD) that the VBV computing section 104 outputs to the MPEG encoder 103 is equal to the value obtained by multiplying the VDR value per second with 90000.
However, with a known image compression-coding apparatus as shown in FIG. 2, the VBV delay can be determined only within the total sum of the volumes (total_bit_number) of the generated information that the bit counter 105 can hold.
On the other hand, a huge register will have to be arranged within the bit counter 105 to guarantee a sufficient period of time for the encoding operation to count the number of bits representing the volume of the generated information. This entails large cost and the encoding operation cannot be continued beyond the time period corresponding to the capacity of the register.
In view of the above circumstances, it is therefore the object of the present to provide a transmission method and a transmission apparatus adapted to determined the VBV delay (vbv_delay) on the basis of bit late without limiting the encoding time and raising the cost.
A transmission method and a transmission apparatus according to the invention are adapted to control the volume of generated codes on the basis of the occupied volume of the virtual buffer at the side of the reception apparatus. They can achieve the above object by computing the cumulative value of the number of the input bits of all the frames and the theoretical value of the number of the input bits from the bit rate and replacing the cumulative value by an integer value close to the theoretical value when the error between the theoretical value and the cumulative value exceeds a predetermined value.
It will be clear from the above description that, according to the invention, when transmitting a signal by controlling the volume of the generated codes on the basis of the occupied volume of the virtual buffer at the side of the reception apparatus, the cumulative value of the number input bits of all the frames and the theoretical value of the number of the input bits are computationally determined and the cumulative value is replaced by the theoretical value at every number of frames where the theoretical value is expressed by an integer. Then, it is possible to determine the buffer delay (vbv_delay) from the bit rate without limiting the encoding time and raising the cost.
Additionally, according to the invention, when the cumulative value of the number input bits of all the frames and the theoretical value of the number of the input bits are computationally determined and the difference between the theoretical value and the cumulative value exceeds a predetermined level, the cumulative value is replaced by an integer close to the theoretical value. Then, it is also possible to determine the buffer delay (vbv_delay) from the bit rate without limiting the encoding time and raising the cost.